@echo off
@if "%1" == "" goto usage
@if "%2" == "" goto usage
@if "%1" == "iis" goto iis
@if "%1" == "webdev" goto webdev

:iis
@if "%2" == "stop" @iisreset /stop
@if "%2" == "start" @iisreset /start
goto eof

:webdev
@if "%ProgramFiles(x86)%" NEQ "" (set WebDev="%ProgramFiles(x86)%\Common Files\microsoft shared\DevServer\9.0\WebDev.WebServer.EXE")
@if "%ProgramFiles(x86)%" == "" (set WebDev="%ProgramFiles%\Common Files\microsoft shared\DevServer\9.0\WebDev.WebServer.EXE")
@if "%2" == "stop" (taskkill /im WebDev.WebServer.EXE)
@if "%2" == "start"(start /i "" %WebDev% /vpath:/ /port:30320 /path:%OrchardSrc%\Orchard.Web)
goto eof

:usage
@echo Usage
@echo webServer.bat [web server] [option]
@echo.
@echo This batch program starts the web server according to batch parameter
@echo.
@echo web server (first parameter)
@echo     iis    - run orchard in IIS service, the port is 80
@echo     webdev - run orchard in webdev.webserver.exe, the port is 30320
@echo.
@echo option (second parameter)
@echo     start  - start the web service
@echo     stop   - stop the web service

:eof